<template>
  <div class="toolbox-container">
    <el-row>
      <el-col :span="24">
        <h1 class="page-title">工具箱</h1>
      </el-col>
    </el-row>
    <el-row gutter="20">
      <el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="8" v-for="tool in tools" :key="tool.name">
        <el-card class="tool-card" style="margin-bottom: 20px;">
          <p class="tool-name">{{ tool.name }}</p>
          <p class="tool-description">{{ tool.description }}</p>
          <el-button type="primary" @click="goToTool(tool.link)">查看详情</el-button>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'ToolboxView',
  data() {
    return {
      tools: [
        {
          name: '理论练习助手',
          description: '移动应用与开发理论练习',
          link: '/toolbox/question/1'
        },
        {
          name: '理论错题助手',
          description: '理论错题助手',
          link: '/toolbox/question/wrong/1'
        },
        {
          name: '教学计划助手',
          description: '教学计划助手',
          link: ''
        }
        // 更多工具...
      ]
    };
  },
  methods: {
    goToTool(link) {
      this.$router.push(link);
    }
  }
};
</script>

<style scoped>
.toolbox-container {
  padding: 20px;
}

.page-title {
  font-size: 24px;
  text-align: center; /* 居中对齐标题 */
  margin-bottom: 20px;
}

.tool-card {
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
  transition: box-shadow .3s;
  cursor: pointer;
  line-height: 1.5em;
}

.tool-card:hover {
  box-shadow: 0 4px 20px 0 rgba(0,0,0,0.2);
}

.tool-name {
  font-size: 18px; /* 增大工具名字体大小 */
  font-weight: bold; /* 加粗字体 */
}

.tool-description {
  color: #666; /* 淡化描述文本颜色 */
}
</style>
